package com.yankaizhang.blog.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 
 * </p>
 *
 * @author Yankai
 * @since 2020-10-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_article")
public class Article implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private String title;

    /**
     * 文章内容
     */
    private String content;

    /**
     * 创建时间（unix_time_format）
     */
    private Long createTime;

    /**
     * 浏览次数
     */
    private Integer views;

    /**
     * 标签
     */
    private String tags;

    /**
     * 文章状态 0草稿 1公开 2私密
     */
    private Integer status;

    /**
     * 标记：0原创、1转载、2翻译
     */
    private Integer type;

    /**
     * 字数
     */
    private Integer wordCount;

    /**
     * 阅读时间（分钟）
     */
    private Integer readTime;

    public void increaseView(int num){
        this.views += num;
    }
}
